package com.yz.crm.department.model;

import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 部门
 * @author jiangxg
 *
 */
public class Department {

	/** id */
	private String id;
	
	/** 公司id */
	private String companyId;
	
	/** 上级部门id */
	private String parentId;
	
	/** 创建时间 */
	private Date createDate;
	
	/** 修改时间 */
	private Date modifyDate;
	
	/** 部门名称 */
	private String name;
	
	/** 部门代码 */
	private String code;
	
	/** 排序号 */
	private Integer orderNum;
	
	/** 排序号str */
	private String orderNumStr;
	
	/** 创建时间str */
	private String createDateStr;
	
	/** 修改时间str */
	private String modifyDateStr;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getModifyDate() {
		return modifyDate;
	}

	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	public String getOrderNumStr() {
		if(this.orderNum==null){
			return "";
		}
		NumberFormat numForm=new DecimalFormat("#");
		return numForm.format(this.orderNum);
	}

	public void setOrderNumStr(String orderNumStr) {
		this.orderNumStr = orderNumStr;
	}

	public String getCreateDateStr() {
		if(this.createDate==null){
			return "";
		}
		SimpleDateFormat timeFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return timeFormat.format(this.createDate);
	}

	public void setCreateDateStr(String createDateStr) {
		this.createDateStr = createDateStr;
	}

	public String getModifyDateStr() {
		if(this.modifyDate==null){
			return "";
		}
		SimpleDateFormat timeFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return timeFormat.format(this.modifyDate);
	}

	public void setModifyDateStr(String modifyDateStr) {
		this.modifyDateStr = modifyDateStr;
	}
	
}
